//
//  ListenTestInfoViewController.m
//  xpkc
//
//  Created by wanmeizty iOS on 14-8-19.
//  Copyright (c) 2014年 wanmeizty. All rights reserved.
//

#import "ListenTestInfoViewController.h"
#import "DWCustomPlayerViewController.h"
#import "CommentCell.h"
#import "LoginAlertView.h"
#import "CommentAlertView.h"
#import "MBProgressHUD.h"
#import "IntroduceModel.h"

@interface ListenTestInfoViewController ()<UITableViewDataSource,UITableViewDelegate>
{
    ListenTestInfoView *infoView;
    NSDictionary *info;
    NSMutableArray *commentArray;
    NSMutableArray *introduceArray;
    
    UITableView *_introduceTableView;
    UITableView *_commentTableView;
    UIScrollView *_mainScrollView;
    MBProgressHUD *hud;
}
@end

@implementation ListenTestInfoViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    if (IsIOS7) {
        [self setEdgesForExtendedLayout:UIRectEdgeNone];
    }
    introduceArray = [NSMutableArray array];
    commentArray = [NSMutableArray array];
    
    [self creatView];
    [self setviewValue];
    [self createTableView];
    [self getVideoInfo];
    
    
    
    
    
    
    
    
    
    
    
}

-(void)getintroduceData:(NSDictionary *)mydict{
    
//    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
//    hud.labelText = @"加载中";
    
    NSString *module = @"openCourse";
    NSString *interface = @"recommondlectures";
    NSString *timeString = [GetTime getTime];
    NSString *hashString = [[NSString stringWithFormat:@"%@/%@/key/%@/time/%@",module,interface,KEY,timeString] md5];
    NSString *urlString = [NSString stringWithFormat:@"%@/laravel/public/%@/%@/hash/%@/appid/1",URL2,module,interface,hashString];
    
    
    NSLog(@"%@",mydict[@"typeid"]);
    NSLog(@"%@",mydict[@"teacher"]);
    NSDictionary *parameter = @{@"time":timeString,@"typeid":mydict[@"typeid"],@"teacher":mydict[@"teacher"],@"pagecode":@"1"};
    
    
    NSLog(@"%@--%@",urlString,parameter);
    
    //POST请求
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    [manager POST:urlString parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        NSArray * infoArray = [dic objectForKey:@"info"];
        
        
        
        for (NSDictionary * infoDic in infoArray) {
            
            
            //            IntroduceModel * introduceModel = [IntroduceModel introduceModelWithDic:infoDic];
            //            [introduceArray addObject:introduceModel];
            
//            NSLog(@"---------%@",infoDic);
            IntroduceModel * introModel = [[IntroduceModel alloc] init];
            
            introModel.aid = [NSString stringWithFormat:@"%@",infoDic[@"aid"]];
            introModel.price = infoDic[@"price"];
            introModel.trueprice = infoDic[@"trueprice"];
            introModel.name = infoDic[@"name"];
            introModel.teacher = infoDic[@"teacher"];
            
            [introduceArray addObject:introModel];
            
        }
        
        [_introduceTableView reloadData];
       
        [hud setHidden:YES];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        [hud setHidden:YES];
    }];
    
}

#pragma mark - creatview
/**
 *  创建基本视图
 */
-(void)creatView{
    
    infoView = [[ListenTestInfoView alloc]initWithFrame:self.view.bounds];
    [infoView.videoPlayBtn addTarget:self action:@selector(playVideoWith:) forControlEvents:UIControlEventTouchUpInside];
    [infoView.introduceBtn addTarget:self action:@selector(changeCellClick:) forControlEvents:UIControlEventTouchUpInside];
    [infoView.commentBtn addTarget:self action:@selector(changeCellClick:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:infoView];
    
    [infoView.videoImageView setImageWithURL:[NSURL URLWithString:self.image]];
    infoView.videoTitle.text = self.titles;
    infoView.videoDuration.text = [NSString stringWithFormat:@"%@分钟",self.duration];
    infoView.viewLabel.text = [NSString stringWithFormat:@"%@人观看",self.play_num];
    infoView.videoTeacher.text = self.teacher;
    //    infoView.videoPubDate.text = self.title;
    [infoView setStarImageViewWithNumber:[NSString stringWithFormat:@"%@",self.score]];
    
}
/**
 *  创建信息视图
 */
-(void)createTableView
{
    _mainScrollView = [[UIScrollView alloc]init];
    _mainScrollView.frame = CGRectMake(0, infoView.lineView2.frame.origin.y+1, SCREEN_WIDTH, SCREEN_HEIGHT-64);
    _mainScrollView.contentSize = CGSizeMake(2*SCREEN_WIDTH, SCREEN_HEIGHT-64);
    _mainScrollView.pagingEnabled = YES;
    _mainScrollView.bounces = NO;
    _mainScrollView.delegate = self;
    _mainScrollView.scrollEnabled = NO;
    _mainScrollView.tag = 1;
    _mainScrollView.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:_mainScrollView];
    //    logdebug(@"%f===%f",infoView.lineView2.frame.origin.y,infoView.height);
    
    _introduceTableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - (infoView.lineView2.frame.origin.y+1)) style:UITableViewStylePlain];
    _introduceTableView.delegate = self;
    _introduceTableView.dataSource = self;
    _introduceTableView.tableHeaderView.clipsToBounds = YES;
    _introduceTableView.tag = 2;
    _introduceTableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    [_mainScrollView addSubview:_introduceTableView];
    
    _commentTableView = [[UITableView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - (infoView.lineView2.frame.origin.y+1)) style:UITableViewStylePlain];
    _commentTableView.delegate = self;
    _commentTableView.dataSource = self;
    _commentTableView.tableHeaderView.clipsToBounds = YES;
    _commentTableView.contentInset = UIEdgeInsetsMake(56, 0, 0, 0);
    _commentTableView.backgroundColor = [UIColor clearColor];
    _commentTableView.tag = 3;
    _commentTableView.separatorStyle=UITableViewCellSeparatorStyleNone;
    [_mainScrollView addSubview:_commentTableView];
    
    //评论的相关
    UIView *commentHeadView = [[UIView alloc]init];
    commentHeadView.frame = CGRectMake(0, -56, SCREEN_WIDTH, 56);
    [_commentTableView addSubview:commentHeadView];
    
    UIView *lineView = [[UIView alloc]init];
    lineView.frame = CGRectMake(0, 55, SCREEN_WIDTH, 1);
    lineView.backgroundColor = [UIColor lightGrayColor];
    [commentHeadView addSubview:lineView];
    
    
    UILabel *commentLabel = [[UILabel alloc]init];
    commentLabel.text = @"评价该课程";
    commentLabel.textColor = [UIColor lightGrayColor];
    commentLabel.textAlignment = NSTextAlignmentCenter;
    commentLabel.font = [UIFont systemFontOfSize:10];
    commentLabel.frame = CGRectMake(0, 0, 100, 10);
    commentLabel.center = CGPointMake(SCREEN_WIDTH/2.0, 17);
    [commentHeadView addSubview:commentLabel];
    
    UIView *starBaseView = [[UIView alloc]init];
    starBaseView.frame = CGRectMake(0, 0, 115, 15);
    starBaseView.center = CGPointMake(SCREEN_WIDTH/2.0, 35);
    [commentHeadView addSubview:starBaseView];
    
    for (int i = 0; i< 5; i++) {
        UIButton *starBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [starBtn setImage:[UIImage imageNamed:@"large_star_empty.png"] forState:UIControlStateNormal];
        [starBtn addTarget:self action:@selector(starBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        starBtn.frame = CGRectMake((15+10)*i, 0, 15, 15);
        starBtn.tag = i;
        [starBaseView addSubview:starBtn];
    }
    
}


#pragma mark == func

/**
 *  请求信息
 */
-(void)getVideoInfo{
    
    hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    hud.labelText = @"加载中";
    
    NSString *module = @"openCourse";
    NSString *interface = @"videodetail";
    NSString *timeString = [GetTime getTime];
    NSString *hashString = [[NSString stringWithFormat:@"%@/%@/key/%@/time/%@",module,interface,KEY,timeString] md5];
    NSString *urlString = [NSString stringWithFormat:@"%@/laravel/public/%@/%@/hash/%@/appid/1",URL2,module,interface,hashString];
    
    NSDictionary *parameter = @{@"time":timeString,@"videoid":self.videoId};
    
    NSLog(@"%@",parameter);
    
    //POST请求
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    [manager POST:urlString parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        info = [[dic objectForKey:@"info"]lastObject];
        
        //        NSLog(@"%@",info);
        NSDictionary * infoDic = [[dic objectForKey:@"info"]lastObject];
        NSLog(@"%@",infoDic);
        [self performSelectorOnMainThread:@selector(getintroduceData:) withObject:infoDic waitUntilDone:YES];
        [_introduceTableView reloadData];
        [_commentTableView reloadData];
//         [hud setHidden:YES];
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
//         [hud setHidden:YES];
    }];
    
    
    
    
    
}
/**
 *  界面赋值
 */
-(void)setviewValue{
    //评价接口
    NSString *module = @"openCourse";
    NSString *interface = @"coursecomment";
    NSString *timeString = [GetTime getTime];
    NSString *hashString = [[NSString stringWithFormat:@"%@/%@/key/%@/time/%@",module,interface,KEY,timeString] md5];
    NSString *urlString = [NSString stringWithFormat:@"%@/laravel/public/%@/%@/hash/%@/appid/1",URL2,module,interface,hashString];
    
    NSDictionary *parameter = @{@"time":timeString,@"videoid":self.videoId};
    //POST请求
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    manager.responseSerializer = [AFHTTPResponseSerializer serializer];
    [manager POST:urlString parameters:parameter success:^(AFHTTPRequestOperation *operation, id responseObject) {
        //
        NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingMutableLeaves error:nil];
        
        
       
        NSArray *infos = [dic objectForKey:@"info"];
        
        for (NSDictionary * item in infos) {
            NSString * time = [GetTime getYYMMDDHHMMWithDate:[NSDate dateWithTimeIntervalSince1970:[[item objectForKey:@"addtime"]intValue]]];
            NSString * star =[NSString stringWithFormat:@"%@",[item objectForKey:@"score"]];
            NSString * name = [item objectForKey:@"userid"];
            NSString * content =[item objectForKey:@"content"];
            NSString * face = [item objectForKey:@"face"];
            NSDictionary *dic =[NSDictionary dictionaryWithObjectsAndKeys:name,@"user",time,@"time",star,@"starcount",content,@"content",face,@"face",nil];
            [commentArray addObject:dic];
        }
        [_introduceTableView reloadData];
        [_commentTableView reloadData];

    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {

    }];
    
    
    
    
}
/**
 *  按钮的点击事件
 *
 */
-(void)playVideoWith:(UIButton *)btn{
    if ([[[NSUserDefaults standardUserDefaults]valueForKey:WIFI_ONLY]isEqualToString:@"NO"]) {
        //随便看
        [self gotoMediaPlayer];
    }else{
        //先判断网络状况
        if (![[GetNetworkStatues getNetWorkStates]isEqualToString:@"WIFI"])
        {
            UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"警告" message:@"当前处于非WIFI网络下,观看视频会产生大量流量，是否确认观看" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定观看", nil];
            alert.tag = 100;
            alert.delegate = self;
            [alert show];
        }else{
            [self gotoMediaPlayer];
        }
    }
}
/**
 *  按钮点击切换
 */
-(void)changeCellClick:(UIButton *)btn
{
    for (UIView *view in btn.superview.subviews) {
        if ([view isKindOfClass:[UIButton class]]) {
            UIButton *button = (UIButton *)view;
            if (button.tag == btn.tag) {
                button.selected = YES;
                [UIView animateWithDuration:0.3 animations:^{
                    infoView.btnSliderView.frame = CGRectMake(btn.frame.origin.x, 38, SCREEN_WIDTH/2.0, 2);
                    btn.transform = CGAffineTransformMakeScale(1.2, 1.2);
                }];
            }
            else {
                button.selected = NO;
                [UIView animateWithDuration:0.3 animations:^{
                    button.transform = CGAffineTransformMakeScale(1, 1);
                }];
            }
        }
    }
    if (btn.tag == 1) {
        [_mainScrollView setContentOffset:CGPointMake(0, 0) animated:YES];
    }
    else {
        [_mainScrollView setContentOffset:CGPointMake(SCREEN_WIDTH, 0) animated:YES];
    }
}
/**
 *  星评按钮点击切换
 */
-(void)starBtnClick:(UIButton *)btn
{
    for (UIButton *button in btn.superview.subviews) {
        [button setImage:[UIImage imageNamed:@"large_star_empty.png"] forState:UIControlStateNormal];
        if (button.tag <= btn.tag) {
            [button setImage:[UIImage imageNamed:@"large_star_full.png"] forState:UIControlStateNormal];
        }
    }
    logdebug(@"%ld星评价",btn.tag+1);
    if ([UserMessage sharedUserMessage].isLogin) {
        //ShowAlertMsg(@"评价页");
        CommentAlertView * comment =[[CommentAlertView alloc] initWithFrame:CGRectMake(55, 64, SCREEN_WIDTH-50*2, SCREEN_WIDTH-50*2)];
        [comment show];
        comment.videoId=self.videoId;
        comment.star=[NSString stringWithFormat:@"%ld",btn.tag+1];
        
        
    }else{
        [[[LoginAlertView alloc]initWithFrame:CGRectMake((SCREEN_WIDTH-250)*0.5,200, 250, 170)]showWithMessage:@"请登录后评价~"];
        //ShowAlertMsg(@"请登陆后评价");
        
    }
}


/**
 *  播放视频
 */
-(void)gotoMediaPlayer{
    ListenTestModel *model=[_videoListArray objectAtIndex:_myNumber];
    NSString *videoIdString = [info objectForKey:@"courseware"];
    
    //    NSString *videoName = [NSString stringWithFormat:@"%@",[info objectForKey:@"subjectname"]];
    //跳转播放界面
    DWCustomPlayerViewController *player = [[DWCustomPlayerViewController alloc]init];
    player.videoListArray = _videoListArray;
    player.drm = NO;
    player.videoId = videoIdString;
    player.videoName = model.title;
    player.nextArray = self.nextArrray;
    player.nowVideo = self.nowVideo;
    player.tem = 0;
    player.playerReturn= ^(NSInteger num){
        //logdebug(@"返回视频位置%d",num);
        //        [self.navigationController popToRootViewControllerAnimated:YES];
        //[self performSelector:@selector(backtolistentest) withObject:nil afterDelay:0.01];
    };
    DWCustomPlayerNavViewController *navVC = [[DWCustomPlayerNavViewController alloc]initWithRootViewController:player];
    [self presentViewController:navVC animated:YES completion:nil];
}



#pragma mark == UITableViewDelegate
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (tableView.tag == 3) {
        return commentArray.count;
    }else if(tableView.tag == 2){
        return introduceArray.count;
    }else{
        return 1;
    }
    NSLog(@"%ld",commentArray.count);
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView.tag == 3) {
        CommentCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (!cell) {
            cell = [[CommentCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        }
        //cell.headImageView = nil;
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        NSDictionary *dic = [commentArray objectAtIndex:indexPath.row];
        cell.userNameLabel.text = [dic objectForKey:@"user"];
        cell.timeLabel.text = [dic objectForKey:@"time"];
        cell.starCount = [dic objectForKey:@"starcount"];
        cell.contentLabel.text = [dic objectForKey:@"content"];
        cell.headImageView.image=[UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[dic objectForKey:@"face"]]]];
        [cell setCellFrame];
        return cell;
    }else if (tableView.tag==2){
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (!cell) {
            cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
        }
        IntroduceModel * introModel = introduceArray[indexPath.row];
        cell.textLabel.text=introModel.name;
        cell.textLabel.numberOfLines = 2;
        cell.textLabel.font = [UIFont systemFontOfSize:15];
        cell.detailTextLabel.text = [NSString stringWithFormat:@"%@\t     %@元",introModel.teacher,introModel.trueprice];
        UILabel * lineLabel = [[UILabel alloc] initWithFrame:CGRectMake(1, 59, SCREEN_WIDTH-2, 1)];
        [cell addSubview:lineLabel];
        lineLabel.backgroundColor = [UIColor grayColor];
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        return cell;
        
    }else {
        
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
        if (!cell) {
            cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
        }
        
        return cell;
    }
}
-(CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 88;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (tableView.tag == 3) {
        NSDictionary *dic = [commentArray objectAtIndex:indexPath.row];
        NSString *str = [dic objectForKey:@"content"];
        CGSize contentSize = [str boundingRectWithSize:CGSizeMake(SCREEN_WIDTH - 35 - 35 - 30, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:11]} context:nil].size;
        return contentSize.height + 38;
    }else if(tableView.tag == 2){
        return 60;
    }else{
        
        return 0;
    }
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
    
    if (tableView.tag == 2) {
        
        IntroduceModel * introModdel = introduceArray[indexPath.row];
        
        NSLog(@"%@",introModdel.aid);
        //        self.videoId = introModdel.aid;
        
        //        [self getVideoInfo];
        
        
    }
    
    
}

#pragma mark == scrolldelegate ==
-(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (scrollView != _mainScrollView) {
        if (scrollView.contentOffset.y>(scrollView == _commentTableView?-56:0)) {
            [UIView animateWithDuration:0.3 animations:^{
                //				infoView.frame = CGRectMake(0, - CGRectGetMaxY(infoView.lineView2.frame) +40 , SCREEN_WIDTH, SCREEN_HEIGHT);
                //
                //				_mainScrollView.frame = CGRectMake(0, 40, SCREEN_WIDTH, SCREEN_HEIGHT - 64);
                //				_introduceTableView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-116);
                //				_commentTableView.frame = CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT-116);
                
                infoView.top = -infoView.lineView2.centerY+40;
                _mainScrollView.top = 40;
                _commentTableView.top = 0;
                _introduceTableView.top = 0;
                
            }completion:^(BOOL finished) {
                //
                _mainScrollView.height = SCREEN_HEIGHT;
                _introduceTableView.height = SCREEN_HEIGHT-64-40;
                _commentTableView.height = SCREEN_HEIGHT-64-40;
            }];
        }
        else if (scrollView.contentOffset.y<(scrollView == _commentTableView?-116:-60))
        {
            [UIView animateWithDuration:0.3 animations:^{
                //				infoView.frame = CGRectMake(0, 0 , SCREEN_WIDTH, SCREEN_HEIGHT);
                //				_mainScrollView.frame = CGRectMake(0, infoView.lineView2.frame.origin.y+1, SCREEN_WIDTH, SCREEN_HEIGHT-64);
                //				_introduceTableView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - (infoView.lineView2.frame.origin.y+1));
                //				_commentTableView.frame = CGRectMake(SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT - 64 - (infoView.lineView2.frame.origin.y+1));
                infoView.top = 0;
                _mainScrollView.top = infoView.lineView2.centerY+1;
                _introduceTableView.top = 0;
                _commentTableView.top = 0;
            }completion:^(BOOL finished) {
                _mainScrollView.height = SCREEN_HEIGHT;
                _introduceTableView.height = SCREEN_HEIGHT-64-infoView.lineView2.frame.origin.y-1;
                _commentTableView.height = SCREEN_HEIGHT-64-infoView.lineView2.frame.origin.y-1;
            }];
        }
    }
}
-(void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
    NSLog(@"动画结束");
    if (scrollView == _mainScrollView) {
        if (scrollView.contentOffset.x/SCREEN_WIDTH == 0) {
            [self changeCellClick:infoView.introduceBtn];
        }
        else
        {
            [self changeCellClick:infoView.commentBtn];
        }
    }
}

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
    if (buttonIndex == 0) {
        return;
    }else if (buttonIndex == 1){
        [self gotoMediaPlayer];
    }
}

#pragma mark -
#pragma mark == other ==
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
